package cn.xopencode.recordservice.provider.roomin;

import cn.xopencode.common.framework.vo.CommonResult;
import cn.xopencode.common.framework.vo.PageResult;
import cn.xopencode.recordservice.manager.roomin.RoomInRecordManager;
import cn.xopencode.recordservice.rpc.roomin.RoomInRecordRpc;
import cn.xopencode.recordservice.rpc.roomin.dto.*;
import cn.xopencode.recordservice.rpc.roomin.vo.RoomInRecordPageVO;
import cn.xopencode.recordservice.rpc.roomin.vo.RoomInRecordUpdateVO;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 配电室出入记录 Rpc 实现类
 */
@DubboService(version = "${dubbo.provider.RoomInRecordRpc.version}")
public class RoomInRecordRpcImpl implements RoomInRecordRpc {

    @Autowired
    private RoomInRecordManager roomInRecordManager;

    @Override
    public CommonResult<Integer> createRoomInRecord(RoomInRecordCreateDTO createDTO) {
        return CommonResult.success(roomInRecordManager.createRoomInRecord(createDTO));
    }

    @Override
    public CommonResult<PageResult<RoomInRecordPageVO>> pageRoomInRecord(RoomInRecordPageDTO pageDTO) {
        return CommonResult.success(roomInRecordManager.pageRoomInRecord(pageDTO));
    }

    @Override
    public CommonResult<RoomInRecordUpdateVO> getRoomInRecordById(String id) {
        return CommonResult.success(roomInRecordManager.getRoomInRecordById(id));
    }

    @Override
    public CommonResult<Integer> updateRoomInRecord(RoomInRecordUpdateDTO updateDTO) {
        return CommonResult.success(roomInRecordManager.updateRoomInRecord(updateDTO));
    }

    @Override
    public CommonResult<PageResult<AdminRoomInRecordVO>> getAdminPageRoomInRecord(AdminRoomInRecordDTO pageDTO) {
        return CommonResult.success(roomInRecordManager.getAdminPageRoomInRecord(pageDTO));
    }

}
